/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.javatrainning.duongnt.b1;

import java.util.Scanner;

/**
 *
 * @author ThuyDuong
 */
public class Bai5Muc1Fibo {
 public static void main(String[] args) {
        System.out.println("nhap a");
        long a;
        Scanner sc = new Scanner(System.in);
        a = sc.nextLong();
        System.out.println("so Fibo thu " +a+ " la "+ Fibo(a));
}

    private static int Fibo(long a) {
        int i=0,j=1,n,d=2;
        while(d<=a)
        {
            n=i+j;
            i=j;
            j=n;
            d++;
        }
        return j;
    }
}
